/*****************************************************************************
 * Open MCT, Copyright (c) 2014-2016, United States Government
 * as represented by the Administrator of the National Aeronautics and Space
 * Administration. All rights reserved.
 *
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * Open MCT includes source code licensed under additional open source
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 * this source code distribution or the Licensing information page available
 * at runtime from the About dialog for additional information.
 *****************************************************************************/
.filter,
.t-filter {
	input.t-filter-input {
		&:not(.ng-dirty) + .t-a-clear {
			display: none;
		}
	}
	.icon.ui-symbol {
		border-radius: $controlCr;
		display: inline-block;
		font-size: 1.3em;
		height: $formInputH;
		line-height: $formInputH;
		padding: 0px 5px;
		vertical-align: middle;
		&:hover {
			background: rgba(white, 0.1);
		}
	}
	.s-a-clear.ui-symbol {
		$mgn: 4.5px;
		$d: $formInputH - $mgn * 2;
		$cb: #fff;
		$cf: #333;
		border-radius: $controlCr;
		box-sizing: border-box;
		opacity: 0.2;
		background: $cb;
		color: $cf;
		display: block;
		position: absolute;
		height: $d; width: $d;
		line-height: $d;
		margin-top: $d * -0.5;
		overflow: hidden;
		padding-top: 1px;
		right: $mgn; top: 50%;
		text-align: center;
		z-index: 5;
		&:hover {
			opacity: 0.6;
			background-color: $colorKey;
		}
	}
}

.top-bar {
	input.filter {
		$h: $ueTopBarH;
		$ip: 10px;
		font-size: .9em;
		height: $h;
		line-height: $h;
		margin-right: $interiorMargin;
		padding-left: $ip;
		padding-right: $ip;
		vertical-align: top;
	}
	.icon-filter {
		font-size: 1.4em;
	}
}

.l-filter {
    $iconEdgeM: 4px;
    $iconD: $formInputH - ($iconEdgeM * 2);
    @extend .icon-magnify;
    // Adds a magnifying glass before, holds an input and a clear button
    display: inline-block;
    position: relative;

    input[type="search"] {
        padding: 2px ($iconD + $interiorMargin);
    }
    .clear-icon,
    .menu-icon,
    &:before {
        box-sizing: border-box;
        display: inline-block;
        line-height: inherit;
        position: absolute;
        top: 50%;
        @include transform(translateY(-50%));
        z-index: 1;
    }

    &:before {
        // Magnify glass icon
        left: $interiorMargin;
        @include trans-prop-nice(color, 250ms);
        pointer-events: none;
    }

    .clear-icon {
        right: $iconEdgeM;
        // Icon is visible only when there is text input
        visibility: hidden;
        opacity: 0;
        &.show {
            visibility: visible;
            opacity: 1;
        }

        &:hover {
            color: pullForward($colorInputIcon, 10%);
        }
    }
}

.s-filter {
    input[type="search"] {
        @include input-base();
    }
    .clear-icon,
    .menu-icon,
    &:before {
        color: $colorInputIcon;
        cursor: pointer;
        font-family: symbolsfont;
        @include trans-prop-nice((opacity, color), 150ms);
    }
    // Make icon lighten when hovering over search bar
    &:hover:before {
        color: pullForward($colorInputIcon, 10%);
    }
}